Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render style tags as plain text in md editor #429

Closed
wants to merge 1 commit into from

Conversation

IshavSohal
Copy link
Member

@IshavSohal IshavSohal commented Nov 22, 2024

Related Item(s)

#423

Changes

  • Render style tags as plain text within the v-md-editor component, by replacing < and > with ‹ and › (respectively)
  • This was done so that any pair of opening and closing style tags don't get interpreted as a style sheet by the rendering function of the v-md-editor component

Testing

Steps:

  1. Open any product
  2. Open a slide containing a text panel
  3. Within the editor of the text panel, try typing variations of a <style> tag (ex. with a forward slash at front/end, with whitespace in between, etc.)
  4. Observe that all variations of a <style> tag now have < and > replaced with ‹ and › (respectively)

This change is Reviewable

@IshavSohal IshavSohal added the PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review. label Nov 22, 2024
Copy link

Your demo site is ready! 🚀 Visit it here: https://ramp4-pcar4.github.io/storylines-editor/issue-423

Copy link
Member

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have in the past used <style> tags in text panels as a hacky way of applying CSS to specific products. Spencer recently made a change that allows us to create product-specific CSS files, so this PR should be fine. We may want to go back and look at previously created products and ensure that we aren't still using this old hacky method anymore.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @IshavSohal)

Copy link
Member

@yileifeng yileifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @IshavSohal)

Copy link
Member

@spencerwahl spencerwahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have in the past used <style> tags in text panels as a hacky way of applying CSS to specific products

This is still currently the only way to add styles to a storylines product through the editor.

I'm hesitant to merge this as it takes away something possibly useful still in order to save a user from themselves. I think in the best case no one needs to add in style tags and therefore this should do nothing, and in the worst case this causes issues.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @IshavSohal)

@szczz szczz added the Meeting Topic topic for future meeting label Dec 10, 2024
@szczz szczz closed this Dec 17, 2024
@szczz szczz removed the Meeting Topic topic for future meeting label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants